﻿using System;
using DDotNet.ORMapping.Attribute;
using DDotNet.ORMapping.Attribute.DirectAccess;
using DDotNet.ORMapping.OREntity;

namespace Benchmark.Entitie
{
    [Serializable()]
    [DBMapping("MainDB")]
    [DirectEntityMapping("TB_Bechmark")]
    public class BenchmarkItem : BusinessEntityBase
    {
        #region Fields

        private int _ID;
        private string _TextField;
        private int _NumberField;
        private decimal _MoneyField;
        private decimal _DecimalField;
        private float _FloatField;
        private DateTime _DateTimeField;
        private string _MemoField;
        private short _SmallField;
        private bool _BitField;

        #endregion

        [PropertyMapping("BitField")]
        public bool BitField
        {
            get { return _BitField; }
            set
            {
                _BitField = value;
                base.MarkDirty("BitField");
            }
        }

        [PropertyMapping("SmallField")]
        public short SmallField
        {
            get { return _SmallField; }
            set
            {
                _SmallField = value;
                base.MarkDirty("SmallField");
            }
        }

        [PropertyMapping("MemoField")]
        public string MemoField
        {
            get { return _MemoField; }
            set
            {
                _MemoField = value;
                base.MarkDirty("MemoField");
            }
        }

        [PropertyMapping("DateTimeField")]
        public DateTime DateTimeField
        {
            get { return _DateTimeField; }
            set
            {
                _DateTimeField = value;
                base.MarkDirty("DateTimeField");
            }
        }

        [PropertyMapping("FloatField")]
        public float FloatField
        {
            get { return _FloatField; }
            set
            {
                _FloatField = value;
                base.MarkDirty("FloatField");
            }
        }

        [PropertyMapping("DecimalField")]
        public decimal DecimalField
        {
            get { return _DecimalField; }
            set
            {
                _DecimalField = value;
                base.MarkDirty("DecimalField");
            }
        }

        [PropertyMapping("MoneyField")]
        public decimal MoneyField
        {
            get { return _MoneyField; }
            set
            {
                _MoneyField = value;
                base.MarkDirty("MoneyField");
            }
        }

        [PropertyMapping("NumberField")]
        public int NumberField
        {
            get { return _NumberField; }
            set
            {
                _NumberField = value;
                base.MarkDirty("NumberField");
            }
        }

        [PropertyMapping("TextField")]
        public string TextField
        {
            get { return _TextField; }
            set
            {
                _TextField = value;
                base.MarkDirty("TextField");
            }
        }

        [EntityPrimaryKey(true)]
        [PropertyMapping("ID")]
        public int ID
        {
            get { return _ID; }
            set
            {
                _ID = value;
                base.MarkDirty("ID");
            }
        }
    }
}